#include "Topic.h"
#include <cassert>
#include <iostream>

#include "leveldb/options.h"

int main(int argc, const char * argv[]){
	Topic topic("test.db", leveldb::Options());
	topic.open();
	assert(topic.put("hello", "world").ok());

	std::string value;
	assert(topic.get("hello", value).ok());
	assert(value == "world");

	assert(topic.del("hello").ok());

	auto s = topic.get("hello", value);
	if(!s.ok()){
		std::cout << "get key failed:" << s.ToString() << std::endl;
	}

	topic.close();
	return 0;
}

